How an event becomes a file - the Add Event picker, one tab per open event, and the exact name each one is saved under.
Events covers what each event means and when it runs, with the full list and the alarm/collision worked examples. This page only covers the Code tab's own mechanics for adding, opening and naming one - read Events first if you have not already.
An object's Events list has its own +, which offers every event kind the API table's Events category defines - the same list Events' own table documents, always exactly in sync with it because both read the same one source of truth (gbml/api/events.js). A parametrized kind (Alarm, Button, Collision, User) asks for its own parameter right there - which alarm index, which button and phase, which object, which user index - before adding the event, so there is never an event in the list you cannot tell apart from a same-kind sibling.
Opening an event (or a script) gives it its own tab in the middle pane, with the Blocks | Text bar described on The Code tab. Several events can be open at once, across different objects, and each remembers its own scroll position and selection independently.
Every event is a real file, named for exactly what it is - the same vocabulary the API table, the checker and the project file all share (never a second, editor-only name for the same thing):
| Editor's Add Event picker | File on disk |
|---|---|
| Create | create.gbml |
| Step | step.gbml |
| Alarm 3 | alarm_3.gbml |
| Collision with obj_wall | collision_obj_wall.gbml |
| Button Pressed A | button_pressed_A.gbml |
| User 0 | user_0.gbml |
A plain (unparametrized) event's filename is just its own kind; a parametrized one appends its index, its button/phase, or the other object's name. You will see this convention again reading a project's own objects/<name>/ folder directly, or a Problems row naming the exact file a compile error came from.